package com.weixing.mall.provider.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.annotation.NoNeedAccess;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.model.query.GoodTransRepotDetailsQuery;
import com.weixing.mall.provider.model.query.GoodTransRepotQuery;
import com.weixing.mall.provider.model.vo.report.GoodTransRepotDetailsVo;
import com.weixing.mall.provider.model.vo.report.GoodTransRepotVo;
import com.weixing.mall.provider.service.IFrontShipperReprotService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Small
 * @since 2020-04-07
 */
@RestController
@RequestMapping("/report-shipper")
public class ReportShipperController extends BaseController {

    @Autowired
    private IFrontShipperReprotService reprotService;

    @ApiOperation(value = "调拨单报表")
    @GetMapping("/transReportList")
    @NoNeedAccess
    public Result goodTransRepotList(GoodTransRepotQuery goodTransRepotQuery){
        IPage<GoodTransRepotVo> result=reprotService.goodTransRepotList(initMpPage(),goodTransRepotQuery);
        return ResultUtil.success(result);
    }
    @ApiOperation(value = "调拨单报表整体情况")
    @GetMapping("/transReportTotal")
    @NoNeedAccess
    public Result commodityDepartSale(GoodTransRepotQuery goodTransRepotQuery){
        GoodTransRepotVo result=reprotService.goodTransRepotTotal(goodTransRepotQuery);
        return ResultUtil.success(result);
    }
    @ApiOperation(value = "调拨单报表详情")
    @GetMapping("/transReportListDetails")
    @NoNeedAccess
    public Result transReportListDetails(@Validated GoodTransRepotDetailsQuery goodTransRepotQuery){
        List<GoodTransRepotDetailsVo> result=reprotService.goodTransRepotDetails(goodTransRepotQuery);
        return ResultUtil.success(result);
    }
}
